From: Philip Withnall Date: Mon, 21 Jan 2019 18:11:59 +0000 (+0000) Subject: polkitAgent: Destroy session from dialogue closed handler X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~897^2^2~135 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=081d94e0f680578d4d53229c96aff83eff1fcbc2;p=gnome-shell.git polkitAgent: Destroy session from dialogue closed handler Rather than explicitly destroying the session after calling close(), destroy it from the `closed` signal handler. This also means we can make the method internal. Signed-off-by: Philip Withnall https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/357 --- diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js index f03af35fc..7f38e122e 100644 --- a/js/ui/components/polkitAgent.js +++ b/js/ui/components/polkitAgent.js @@ -168,7 +168,7 @@ var AuthenticationDialog = new Lang.Class({ }, performAuthentication() { - this.destroySession(); + this._destroySession(); this._session = new PolkitAgent.Session({ identity: this._identityToAuth, cookie: this._cookie }); this._sessionCompletedId = this._session.connect('completed', this._onSessionCompleted.bind(this)); @@ -300,7 +300,7 @@ var AuthenticationDialog = new Lang.Class({ this._ensureOpen(); }, - destroySession() { + _destroySession() { if (this._session) { if (!this._completed) this._session.cancel(); @@ -331,6 +331,8 @@ var AuthenticationDialog = new Lang.Class({ if (this._sessionUpdatedId) Main.sessionMode.disconnect(this._sessionUpdatedId); this._sessionUpdatedId = 0; + + this._destroySession(); }, }); Signals.addSignalMethods(AuthenticationDialog.prototype); @@ -401,7 +403,6 @@ var AuthenticationAgent = new Lang.Class({ _completeRequest(dismissed) { this._currentDialog.close(); - this._currentDialog.destroySession(); this._currentDialog = null; if (this._sessionUpdatedId)